import request from './request'
import { mockMemberList } from '@/mock/member'

const useMock = true
// 添加成员
export function addMember(data) {
  return request.post('/members/add', data)
}

// 获取成员列表（可选按部门过滤）
export function getMemberList() {
  if (useMock) {
    return Promise.resolve({
      code: 200,
      data: mockMemberList
    })
  } else {
    return request.get('/members/list')
  }
}

// 修改成员信息
export function updateMember(data) {
  return request.post('/members/update', data)
}

// 删除成员
export function deleteMember(id) {
  return request.post('/members/delete', { id })
}
